package com.xushi.model;

import com.xushi.bean.State;

import javax.persistence.*;

@Entity
@Table(name = "template")
public class Template {
    public Template() {
    }

    public Template(String username, String templateName, String title, String description, String serveUrl,
                    String type, String backgroundImgPath) {
        this.username = username;
        this.name = templateName;
        this.title = title;
        this.description = description;
        this.serveUrl = serveUrl;
        this.type = type;
        this.backgroundImgPath = backgroundImgPath;
        this.state = State.ACTIVE.getState();
    }

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "name")
    private String name;

    @Column(name = "username")
    private String username;

    @Column(name = "state")
    private String state;

    @Column(name = "description")
    private String description;

    @Column(name = "serve_url")
    private String serveUrl;

    @Column(name = "background_img_path")
    private String backgroundImgPath;

    @Column(name = "title")
    private String title;

    @Column(name = "type")
    private String type;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getServeUrl() {
        return serveUrl;
    }

    public void setServeUrl(String serveUrl) {
        this.serveUrl = serveUrl;
    }

    public String getBackgroundImgPath() {
        return backgroundImgPath;
    }

    public void setBackgroundImgPath(String backgroundImgPath) {
        this.backgroundImgPath = backgroundImgPath;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
